﻿#region Using directives

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;

using System;
using System.Text;

using Weazel.Gezel.Model;
using Weazel.Gezel.Parser;
using Weazel.Gezel.Model.Errors;
#endregion

namespace Weazel.Gezel.Model.Test
{
  [TestClass]
  public class TestIpBlockVerification
  {
    [TestMethod]
    public void TestMissingIpType()
    {
      const string description =
        "ipblock myip(out data : ns(9)) { ipparm \"test=7\"; }";

      List<ParseError> parseErrors = new List<ParseError>();
			List<VerificationError> verificationErrors = null;
			List<VerificationWarning> warnings = null;

      Model m = ParseModel.Parse(ref parseErrors, description);

      Assert.AreEqual(0, parseErrors.Count);

      m.Verify(ref verificationErrors, ref warnings);

			Assert.AreEqual(1, verificationErrors.Count);
			Assert.AreEqual(VerificationErrorType.IpBlockNoType, verificationErrors[0].ErrorType);
    }
  }
}
